package main

import "fmt"

func testString() {
	var _string string = "hello"
	fmt.Printf("string[0] = %c\n", _string[0])

	//循环字符串
	for index, val := range _string {
		fmt.Printf("str[%d] => %c\n", index, val)
	}

	//更新字符串中的字符
	var byteArray []byte
	byteArray = []byte(_string)
	byteArray[0] = '9'
	_string = string(byteArray)
	fmt.Print(_string)

	var _aa = "lwl"
	var _rune []rune
	_rune = []rune(_aa)
	fmt.Printf("字符的长度为：%s \n", _rune)

}
func main() {

	testString()
}
